package com.example.demo.config;

import org.jodconverter.JodConverter;
import org.jodconverter.LocalConverter;
import org.jodconverter.office.LocalOfficeManager;
import org.jodconverter.office.OfficeException;
import org.jodconverter.process.WindowsProcessManager;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

//@Configuration
public class OpenOfficeConfig {

    @Bean
    public LocalOfficeManager documentConvert() throws OfficeException {
        LocalOfficeManager.Builder builder = LocalOfficeManager.builder().install();
        builder.processManager(WindowsProcessManager.getDefault());
        LocalOfficeManager build = builder.build();
        build.start();
        return build;
    }
}
